package com.ejerciciolibre;

import java.util.ArrayList;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class ActivityMenuGame extends Activity {
	private ArrayList<Integer> list;
	int valueMinimum = 0;
	int valueMax = 100;
	
	
	/*
	aduanas@fedex.com
	
	584602001436
	
	Luis
	*/
	
	TextView playerName;
	String electionNumberTest;
	Button test1;
	Button test2;
	Button test3;
	Button test4;
	
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
		setContentView(R.layout.activity_screen_game);
		list = new ArrayList<Integer>();		
		for (int i=0;i<11;i++){
			list.add(i);
		}
		playerName = (TextView) findViewById(R.id.textView2);
		test1 = (Button) findViewById(R.id.Window2);
		test2 = (Button) findViewById(R.id.Window3);
		test3 = (Button) findViewById(R.id.Window4);
		test4 = (Button) findViewById(R.id.Window5);
		
		
		
		SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(ActivityMenuGame.this);
        // El modo de tirada, si no está puesto cogerá real

        playerName.setText(sp.getString("PlayerName", "default"));
        electionNumberTest = sp.getString("NumberQuestionnarie", "0");
        
        int QuantityTest = Integer.parseInt(electionNumberTest.toString());
        
        
        
        
        switch (QuantityTest){
        case 1:
        
        	test2.setVisibility(View.INVISIBLE);
        	test3.setVisibility(View.INVISIBLE);
        	test4.setVisibility(View.INVISIBLE);
        	break;
        case 2:
        	test3.setVisibility(View.INVISIBLE);
        	test4.setVisibility(View.INVISIBLE);
        	break;
        case 3: 
        	
        	test4.setVisibility(View.INVISIBLE);
        	break;
        case 4:
        	break;
        
        }

        
        
	}
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}
	public void Action1(View v){
		Intent i = new Intent(this, ActivityQuestionnarie.class);
		i.putExtra("extraValue", 1);
		startActivity(i);
	}
	public void Action2(View v){
		Intent i = new Intent(this, ActivityQuestionnarie.class);
		i.putExtra("extraValue", 2);
		startActivity(i);
	}
	public void Action3(View v){
		Intent i = new Intent(this, ActivityQuestionnarie.class);
		i.putExtra("extraValue", 3);
		startActivity(i);
	}
	public void Action4(View v){
		Intent i = new Intent(this, ActivityQuestionnarie.class);
		i.putExtra("extraValue", 4);
		startActivity(i);
	}
}
